package p270jp.pxv.android.legacy.model;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import p104de.greenrobot.dao.AbstractDaoMaster;
import p104de.greenrobot.dao.identityscope.IdentityScopeType;

/* renamed from: jp.pxv.android.legacy.model.DaoMaster */
/* loaded from: classes2.dex */
public class DaoMaster extends AbstractDaoMaster {
    public static final int SCHEMA_VERSION;

    /* renamed from: jp.pxv.android.legacy.model.DaoMaster$DevOpenHelper */
    /* loaded from: classes2.dex */
    public static class DevOpenHelper extends OpenHelper {
        public DevOpenHelper(Context context, String str, SQLiteDatabase.CursorFactory cursorFactory) {
            super(context, str, cursorFactory);
        }

        @Override // android.database.sqlite.SQLiteOpenHelper
        public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) {
            Log.i("greenDAO", "Upgrading schema from version " + i + " to " + i2 + " by dropping all tables");
            DaoMaster.dropAllTables(sQLiteDatabase, true);
            onCreate(sQLiteDatabase);
        }
    }

    /* renamed from: jp.pxv.android.legacy.model.DaoMaster$OpenHelper */
    /* loaded from: classes2.dex */
    public static abstract class OpenHelper extends SQLiteOpenHelper {
        public OpenHelper(Context context, String str, SQLiteDatabase.CursorFactory cursorFactory) {
            super(context, str, cursorFactory, 4);
        }

        @Override // android.database.sqlite.SQLiteOpenHelper
        public void onCreate(SQLiteDatabase sQLiteDatabase) {
            Log.i("greenDAO", "Creating tables for schema version 4");
            DaoMaster.createAllTables(sQLiteDatabase, false);
        }
    }

    public DaoMaster(SQLiteDatabase sQLiteDatabase) {
        super(sQLiteDatabase, 4);
        registerDaoClass(LikedWorkDao.class);
        registerDaoClass(BrowsingHistoryDao.class);
        registerDaoClass(SearchHistoryDao.class);
        registerDaoClass(EmojiDao.class);
    }

    public static void createAllTables(SQLiteDatabase sQLiteDatabase, boolean z) {
        LikedWorkDao.createTable(sQLiteDatabase, z);
        BrowsingHistoryDao.createTable(sQLiteDatabase, z);
        SearchHistoryDao.createTable(sQLiteDatabase, z);
        EmojiDao.createTable(sQLiteDatabase, z);
    }

    public static void dropAllTables(SQLiteDatabase sQLiteDatabase, boolean z) {
        LikedWorkDao.dropTable(sQLiteDatabase, z);
        BrowsingHistoryDao.dropTable(sQLiteDatabase, z);
        SearchHistoryDao.dropTable(sQLiteDatabase, z);
        EmojiDao.dropTable(sQLiteDatabase, z);
    }

    @Override // p104de.greenrobot.dao.AbstractDaoMaster
    public DaoSession newSession() {
        return new DaoSession(this.f12139db, IdentityScopeType.Session, this.daoConfigMap);
    }

    @Override // p104de.greenrobot.dao.AbstractDaoMaster
    public DaoSession newSession(IdentityScopeType identityScopeType) {
        return new DaoSession(this.f12139db, identityScopeType, this.daoConfigMap);
    }
}
